速報APP / 教育 / Arduino-Android HomeAutomation

Arduino-Android HomeAutomation

價格:免費

更新日期:2014-09-26

檔案大小:722k

目前版本:1.0

版本需求:Android 2.2 以上版本

官方網站:http://anwaarullah.com

Email:syed@anwaarullah.com

Arduino-Android HomeAutomation(圖1)-速報App

A mimimalistic demo app of Voice Controlled Home Appliances using Arduino. The source code for Arduino and Android app will be made available on my blog http://anwaarullah.com soon.

If you need any help in building the Circuit, please email me at syed@anwaarullah.com

Basic Setup:

1. Connect a Bluetooth Module to the Arduino Serial Port

2. Connect 3 Loads (or LEDs for testing) to Pins 8,9 and 10

3. Upload the Arduino Code below

4. Open the App and establish a connection with the Bluetooth Module

5. Select the Appropriate buttons and the LEDs/Load should lit up accordingly

The following pins are connected to the Buttons on the App:

Yellow Lamp = Digital Pin 8 of Arduino

Fan = Digital Pin 9 of Arduino

Red Lamp = Digital Pin 10 of Arduino

To give in voice commands, hit the mic button and say in any of these commands:

"red lamp on"

"red lamp off"

"fan on"

"fan off"

"yellow lamp on"

"yellow lamp off"

I've attached a sample schematic that can be used for reference in connecting.

To see a demo of this application, please visit this video http://vimeo.com/53071330 and navigate to 20:00 on the video. This was a talk where I made this App for a demo.

#### Arduino Source Code ####

char ch = 'A';

int lamp1 = 8;

int lamp2 = 9;

int lamp3 = 10;

void setup()

{

Serial.begin(9600);

pinMode(lamp1, OUTPUT);

pinMode(lamp2, OUTPUT);

pinMode(lamp3, OUTPUT);

Arduino-Android HomeAutomation(圖2)-速報App

digitalWrite(lamp1, LOW);

digitalWrite(lamp2, LOW);

digitalWrite(lamp3, LOW);

}

void loop()

{

if (Serial.available() > 0)

{

ch = Serial.read();

if (ch == '1') {

digitalWrite(lamp1, HIGH);

}

if (ch == '2') {

digitalWrite(lamp2, HIGH);

}

if (ch == '3') {

digitalWrite(lamp3, HIGH);

}

if (ch == '4') {

digitalWrite(lamp1, LOW);

}

if (ch == '5') {

digitalWrite(lamp2, LOW);

}

if (ch == '6') {

digitalWrite(lamp3, LOW);

}

}

delay(500);

ch = 'A';

}

Arduino-Android HomeAutomation(圖3)-速報App

Note: Please be careful while handling high voltage loads. Take all necessary precautions while building the circuit. I'm not responsible for any damage whatever, in any way whatsoever arising out of the use of this App (Physical or Material).